{include file="styles/header.tpl"}
<div id="content" class="content">
	<h1>Archive History</h1>
	
	<table width="100%" style="width:60%; margin-top:20px">
		<tr>
			<th>Archive Name</th>
			<th>Create Date</th>
			<th>Creator</th>
			<th>&nbsp;</th>
		</tr>
	{assign var='c' value=0}
	{foreach from=$arrResult item=result}
		<tr {if ($c % 2 == 1) } class="bg" {/if}>
			{assign var='c' value=$c+1}
			<td>{$result.iname}</td>
			<td>{$result.createdate}</td>
			<td>{$result.admin_username}</td>
			<td>
				<a href="{$smarty.const.HOST_ADMIN}/archive/?n={$result.iname}" target="_blank">View</a>
				|
				<a href="{$smarty.const.HOST_ADMIN}/archive/export/?n={$result.iname}">Download</a>
				{if $AppUI->admin_group_id==$smarty.const.GROUP_Administrator}
				
					{if $result.admin_username !=""} |
						<a href="javascript:do_delete('{$result.iname}');">Delete</a>
					{/if}
				{/if}
			</td>
		</tr>
		{/foreach}
	</table>
</div>
{literal}
<script type="text/javascript">
	function do_delete(n)
	{
		var msg	= 'Remove this archive data. Are you sure?';
		if( confirm(msg) ){
			window.location.href	= HOST_ADMIN + '/archive-log/delete/?i='+n;
		}
	}
</script>
{/literal}
<div id="currenttab" class="category_view_previous_forecast" style="display: none;">
{include file="styles/footer.tpl"}